<style>
    .layui-form-label {
        width: 100px;
    }

    .layui-input-block {
        margin-left: 130px;
    }

    .layui-elem-quote {
        padding: 5px;
        margin-bottom: 15px;
        border-left: 5px solid var(--primary-color);
        font-weight: 600;
    }

    .delthumb {
        position: absolute;
        right: 0;
        z-index: 999;
        cursor: pointer;
        display: none;
    }

    .thumb_control {
        display: block;
    }

    .el-input__inner {
        height: 30px !important;
    }

    .layui-form .el-cascader {
        line-height: 30px;
        ;
    }
</style>
<div class="rightcontent rc-bg-grey">
    <div class="rc-pagepadding ">
        <div class=" rc-pannel ">
            <div class=" rc-pannel-header rc-pagepadding rc-bold"> <i class="iconfont goback rc-pointer">&#xe62b;</i> 编辑标签</div>
            <div class="rc-pannel-body rc-pagepadding">
                <form class="layui-form" action="" id="addform">

                    <div class="layui-form-item">
                        <label class="layui-form-label">标签名</label>
                        <div class="layui-input-block">
                            <input type="text" name="tag" id="tag" autocomplete="off" value="<?php echo $tag['tag']?>" lay-verify="required" class="layui-input" title="分类名称" />
                        </div>
                    </div>

                    <div class="layui-form-item rc-margin-bottom0">
                        <div class="layui-input-block">
                            <button type="button" class="layui-btn layui-btn-primary layui-btn-sm" lay-submit lay-filter="submit">提交</button>
                            <button type="reset" class="layui-btn layui-btn-sm">重置</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script type='text/javascript'>
        layui.use(function() {

            var form = layui.form;

            form.on('submit(submit)', function(data) {
                $.ajax({
                    url: '/app/cms/admin/Tag/edit?id=<?php echo request()->get('id') ?>', //请求路径
                    type: "POST", //请求方式
                    data: data.field, // 默认写法
                    success: function(data) {
                        if (data.code == 0) {
                            toastr_success("编辑成功", function() {
                                window.location.href = '/app/cms/admin/Tag/index';
                            });
                        } else {
                            toastr_error(data.message);
                        }
                    },
                    error: function() {

                    },

                });
            });

        });
    </script>